package edu.jhu.secondhome.database.beans;

/**
 * Database Bean: Room
 */
public class Room {
	
	private String hotelName;
	private String roomNumber;
	private String occupancy;
	private int costPerNight;
	
	public Room() { }

	public Room(String hotelName, String roomNumber, String occupancy, int costPerNight) {
		this.hotelName = hotelName;
		this.roomNumber = roomNumber;
		this.occupancy = occupancy;
		this.costPerNight = costPerNight;
	}

	public String getHotelName() {
		return hotelName;
	}

	public void setHotelName(String hotelName) {
		this.hotelName = hotelName;
	}

	public String getRoomNumber() {
		return roomNumber;
	}

	public void setRoomNumber(String roomNumber) {
		this.roomNumber = roomNumber;
	}

	public String getOccupancy() {
		return occupancy;
	}

	public void setOccupancy(String occupancy) {
		this.occupancy = occupancy;
	}

	public int getCostPerNight() {
		return costPerNight;
	}

	public void setCostPerNight(int costPerNight) {
		this.costPerNight = costPerNight;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + costPerNight;
		result = prime * result
				+ ((hotelName == null) ? 0 : hotelName.hashCode());
		result = prime * result
				+ ((occupancy == null) ? 0 : occupancy.hashCode());
		result = prime * result
				+ ((roomNumber == null) ? 0 : roomNumber.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Room other = (Room) obj;
		if (costPerNight != other.costPerNight)
			return false;
		if (hotelName == null) {
			if (other.hotelName != null)
				return false;
		} else if (!hotelName.equals(other.hotelName))
			return false;
		if (occupancy == null) {
			if (other.occupancy != null)
				return false;
		} else if (!occupancy.equals(other.occupancy))
			return false;
		if (roomNumber == null) {
			if (other.roomNumber != null)
				return false;
		} else if (!roomNumber.equals(other.roomNumber))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Room [hotelName=" + hotelName + ", roomNumber=" + roomNumber
				+ ", occupancy=" + occupancy + ", costPerNight=" + costPerNight +"]";
	}
}
